<fieldset style="height: 67px; margin-top: -10px">
    <legend>条件搜索</legend>

    <form class="layui-form layui-form-pane form-search" action="{:url('')}" onsubmit="return false" method="get"
          autocomplete="off" style="float: left; ">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('日期选择')}</label>
            <label class="layui-input-inline">
                <input data-date-range name="exec_time" value="{$get.exec_time|default=''}"
                       placeholder="{:lang('请选择日期')}" class="layui-input">
            </label>
        </div>

        <div class="layui-form-item layui-inline" style="z-index: 10">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
            <button class="layui-btn layui-btn-primary" onclick="downloadFile()">导 出</button>
        </div>
    </form>

    <script>form.render()</script>
</fieldset>

<script>
    function downloadFile() {
        // 获取搜索参数
        var execTime = $('input[name="exec_time"]').val();

        // 创建一个隐藏的表单
        var form = $('<form></form>');
        form.attr('method', 'POST');
        form.attr('action', '/airobot/monitor_forge/export.html?spm=m-25-114-116'
            + '&exec_time=' + encodeURIComponent(execTime));

        // 将表单添加到 body 中并提交
        $('body').append(form);
        form.submit();
        form.remove(); // 提交后移除表单
    }
</script>